// let 变量名：string|number|boolean=默认值（初始值）
let str: string = '默认值';
// str = 123//错误
let num: number = 123
// num=''//错误
let bool: boolean = true
bool = false
//任意类型
let r: any = 123
r = '123'
r = true
//数组
let arr: Array<number> = [1, 2, 3]
let arr1: Array<string | number | boolean> = [1, 2, 3, '1', true]
let n1: undefined = undefined
let n2: null = null
//never 其他类型的子类型 从来不会出现的值


//枚举
enum Sex {
    male = 1, female = 2,//如果没给默认值name从0开始，如果给了默认值，下一个值从默认值+1开始
}

console.log(Sex.male)

//元组
let arr3: [number, string] = [1, '2']//固定长度的数组，默认值是固定的
